<?php include_partial('global/navbar') ?>
<br/><br/>
<div class="next_head">
    <div class="wrap"><a href="#" class="on">回款中</a>
        <a href="<?php echo url_for("account/inbids")?>" >投标中</a>
        <a href="<?php echo url_for("account/returnedend")?>">已回款</a>
        <a href="<?php echo url_for('account/bidfail')?>">投标失败</a>
       
    </div>
</div>
<div class="content_nav">
        <div class="tag_nav wrap">
            <?php if($pager->getNbResults() > 0):?>
              <?php foreach($pager->getResults() as $one):?>
              <?php $loan = $one->getLoan();
                $list=$one->getList($one->getUserId());
              ?>
                <div class=" pd-n">

                    <table class="table" name="tablelist">
                        <thead>
                            <tr>
                                <th colspan="6">
                                    <div class="ft-l"><a href="<?php echo url_for('project/index?id='.$loan->getId())?>"><?php echo $loan->getTitle()?></a></div>
                                    <div class="ft-r"><a href="javasrict:void(0);" class="clicklist">查看借款详情</a></div>
                                </th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td width="100"><span class="tit-p">借入者：</span></td>
                                <td><span class="alt-p"><?php echo $one->getUserName($loan->getUserId())->getUserName();?></span></td>
                                <td width="100"><span class="tit-p">年利率：</span></td>
                                <td><span class="alt-p"><?php echo round($loan->getMoneyRate());?> %</span></td>
                                <td width="100"><span class="tit-p">借出金额：</span></td>
                                <td><span class="alt-p"><?php echo sfConfig::get('app_symbol').number_format($one->getCurrentPrincipalMoney(),2)?></span></td>
                            </tr>
                            <tr>
                                <td><span class="tit-p">应收本息：</span></td>
                                <td><span class="alt-p"><?php echo sfConfig::get('app_symbol').number_format($one->getSumCurrentMoney($sf_user->getAttribute('user_id')),2)?> </span></td>
                                <td><span class="tit-p">已收本息：</span></td>
                                <td><span class="alt-p"><?php echo sfConfig::get('app_symbol').number_format($one->getPay($sf_user->getAttribute('user_id')),2)?> </span></td>
                                <td><span class="tit-p">待收本息：</span></td>
                                <td><span class="alt-p"><?php echo sfConfig::get('app_symbol').number_format($one->getCurrentMoney(),2)?> </span></td>
                            </tr>
                        </tbody>
                    </table>
                      <div class="item_back" style="display: none;">
                          <table class="table  table-hover table-bordered" >
                          <thead>
                              <tr>
                                  <th>还款日</th>
                                  <th>已收本息</th>
                                  <th>待收本息</th>
                                  <th>待收本金</th>
                                  <th>待收利息</th>
                                  <th>状态</th>
                              </tr>
                          </thead>
                          <tbody>
                              <?php if(!empty($list)): ?>
                              <?php foreach($list as $one_result):?>

                                  <tr>
                                      <td><?php echo date("Y-m-d",  strtotime($one_result["current_end_time"]))?></td>
                                      <td><?php if($one_result["status"] != 1 && $one_result["status"]  != 4):?><?php echo number_format(0,2);?><?php else:?><?php echo number_format($one_result['current_money'],2);?><?php endif;?></td>
                                      <td><?php if($one_result["status"] == 1 && $one_result["status"]  == 4):?><?php echo number_format(0,2);?><?php else:?><?php echo number_format($one_result['current_money'],2);?><?php endif;?></td>
                                      <td><?php if($one_result["status"] == 1 && $one_result["status"]  == 4):?><?php echo number_format(0,2);?><?php else:?><?php echo number_format($one_result['current_principal_money'],2);?><?php endif;?></td>
                                      <td><?php if($one_result["status"] == 1 && $one_result["status"]  == 4):?><?php echo number_format(0,2);?><?php else:?><?php echo number_format($one_result['current_interest_money'],2);?><?php endif;?></td>
                                       <td><?php echo $one->getStatusName($one_result["status"])?></td>
                                  </tr>
                              <?php endforeach;?>
                              <?php endif;?>
                          </tbody>
                          </table>
                      </div>
                   
                </div>
                <hr class="dashed" />
              <?php endforeach;?>
            <?php $uri = url_for("account/backlend");?>
            <ul class="pagination pagination-lg ft-r">
            <?php echo pager_navigation($pager, $uri); ?>
            </ul>
            <?php else:?>
               <div class="nodata">
                您没有回款中的列表
               </div>
            <?php endif;?>
           
        </div>
   
</div>

<script>
    $("#10006").addClass("on");
    
    $(".clicklist").click(function(){
      $(this).parents(".pd-n").find(".item_back").toggle();
    });
</script>

